﻿using AutoMapper;
using BJoin.Application.Dto;
using DapperExtensions;

namespace BJoin.Application.MapperProfile
{
    public class BaseProfile:Profile
    {
        public BaseProfile()
        {
            //Paging
            CreateMap(typeof(Page<>),typeof(ResPagingDto<>));
            //Trim
            CreateMap<string, string>().ConvertUsing(
                   str => !string.IsNullOrEmpty(str) ? str.Trim() : str
                );
        }
    }
}
